home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 4.iso / public / xcdplayer / debug.c < prev    next >
Text File  |  1994-08-01  |  1KB  |  46 lines

  1. /*
  2.  * Copyright (C) 1990 Regents of the University of California.
  3.  *
  4.  * Permission to use, copy, modify, distribute, and sell this software and
  5.  * its documentation for any purpose is hereby granted without fee,
  6.  * provided that the above copyright notice appear in all copies and that
  7.  * both that copyright notice and this permission notice appear in
  8.  * supporting documentation, and that the name of the University of
  9.  * California not be used in advertising or publicity pertaining to
  10.  * distribution of the software without specific, written prior
  11.  * permission.  the University of California makes no representations
  12.  * about the suitability of this software for any purpose.  It is provided
  13.  * "as is" without express or implied warranty.
  14.  */
  15.  
  16. # include <X11/Intrinsic.h>
  17.  
  18. # include <varargs.h>
  19. # include <stdio.h>
  20.  
  21. # include "debug.h"
  22.  
  23. /* VARARGS */
  24. void
  25. debug_printf(va_alist)
  26.     va_dcl
  27. {
  28.     va_list        args;
  29.     char        *fmt;
  30.  
  31.     va_start(args);
  32.  
  33.     /*
  34.      * first arg is whether or not to print.
  35.      */
  36.     if ((va_arg(args, int) == 0) || (debug == False))
  37.         return;
  38.  
  39.     fmt = va_arg(args, char *);
  40.     vfprintf(stdout, fmt, args);
  41.  
  42.     fflush(stdout);
  43.  
  44.     va_end(args);
  45. }
  46.